\(\int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx\) [288]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 34, antiderivative size = 28 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {B \tan (c+d x)}{d}+\frac {B \tan ^3(c+d x)}{3 d} \]

[Out]

B*tan(d*x+c)/d+1/3*B*tan(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {21, 3852} \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {B \tan ^3(c+d x)}{3 d}+\frac {B \tan (c+d x)}{d} \]

[In]

Int[((a*B + b*B*Cos[c + d*x])*Sec[c + d*x]^4)/(a + b*Cos[c + d*x]),x]

[Out]

(B*Tan[c + d*x])/d + (B*Tan[c + d*x]^3)/(3*d)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = B \int \sec ^4(c+d x) \, dx \\ & = -\frac {B \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{d} \\ & = \frac {B \tan (c+d x)}{d}+\frac {B \tan ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.86 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {B \left (\tan (c+d x)+\frac {1}{3} \tan ^3(c+d x)\right )}{d} \]

[In]

Integrate[((a*B + b*B*Cos[c + d*x])*Sec[c + d*x]^4)/(a + b*Cos[c + d*x]),x]

[Out]

(B*(Tan[c + d*x] + Tan[c + d*x]^3/3))/d

Maple [A] (verified)

Time = 1.77 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.89

method result size
derivativedivides \(-\frac {B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) \(25\)
default \(-\frac {B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) \(25\)
risch \(\frac {4 i B \left (3 \,{\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}\) \(34\)
parallelrisch \(-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+1\right ) B}{d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}\) \(68\)
norman \(\frac {-\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 B \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}\) \(99\)

[In]

int((B*a+b*B*cos(d*x+c))*sec(d*x+c)^4/(a+cos(d*x+c)*b),x,method=_RETURNVERBOSE)

[Out]

-1/d*B*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {{\left (2 \, B \cos \left (d x + c\right )^{2} + B\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \]

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)^4/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

1/3*(2*B*cos(d*x + c)^2 + B)*sin(d*x + c)/(d*cos(d*x + c)^3)

Sympy [A] (verification not implemented)

Time = 8.07 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.50 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\begin {cases} \frac {B \left (\frac {\tan ^{3}{\left (c + d x \right )}}{3} + \tan {\left (c + d x \right )}\right )}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \cos {\left (c \right )}\right ) \sec ^{4}{\left (c \right )}}{a + b \cos {\left (c \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)**4/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*(tan(c + d*x)**3/3 + tan(c + d*x))/d, Ne(d, 0)), (x*(B*a + B*b*cos(c))*sec(c)**4/(a + b*cos(c)),
True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)^4/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more de

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.89 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {B \tan \left (d x + c\right )^{3} + 3 \, B \tan \left (d x + c\right )}{3 \, d} \]

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)^4/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

1/3*(B*tan(d*x + c)^3 + 3*B*tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 0.69 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.39 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2\,B\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^2+B\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3} \]

[In]

int((B*a + B*b*cos(c + d*x))/(cos(c + d*x)^4*(a + b*cos(c + d*x))),x)

[Out]

(B*sin(c + d*x) + 2*B*cos(c + d*x)^2*sin(c + d*x))/(3*d*cos(c + d*x)^3)